* Returns: %TRUE if no configuration or any key loaded.
* */
static gboolean
-_load_public_keys (OtPullData *pull_data,
- OstreeSign *sign)
+_load_public_keys (OstreeSign *sign,
+ OstreeRepo *repo,
+ const gchar *remote_name)
{
g_autofree gchar *pk_ascii = NULL;
gboolean loaded_inlined = TRUE;
g_autoptr (GError) error = NULL;
- ostree_repo_get_remote_option (pull_data->repo,
- pull_data->remote_name,
+ ostree_repo_get_remote_option (repo,
+ remote_name,
"verification-file", NULL,
&pk_file, NULL);
- ostree_repo_get_remote_option (pull_data->repo,
- pull_data->remote_name,
+ ostree_repo_get_remote_option (repo,
+ remote_name,
"verification-key", NULL,
&pk_ascii, NULL);
}
static gboolean
-_ostree_repo_sign_verify (OtPullData *pull_data,
+_ostree_repo_sign_verify (OstreeRepo *repo,
+ const gchar *remote_name,
GBytes *signed_data,
GVariant *metadata)
{
continue;
/* Try to load public key(s) according remote's configuration */
- if (!_load_public_keys (pull_data, sign))
+ if (!_load_public_keys (sign, repo, remote_name))
continue;
/* Return true if any signature fit to pre-loaded public keys.
return FALSE;
}
- if (!_ostree_repo_sign_verify (pull_data, signed_data, detached_metadata))
+ if (!_ostree_repo_sign_verify (pull_data->repo, pull_data->remote_name, signed_data, detached_metadata))
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Can't verify commit");
continue;
/* Try to load public key(s) according remote's configuration */
- if (!_load_public_keys (pull_data, sign))
+ if (!_load_public_keys (sign, pull_data->repo, pull_data->remote_name))
continue;
/* Set return to true if any sign fit */
bytes_sig, FALSE);
- if (!_ostree_repo_sign_verify (pull_data, bytes_summary, signatures))
+ if (!_ostree_repo_sign_verify (pull_data->repo, pull_data->remote_name, bytes_summary, signatures))
{
gboolean ret = FALSE;
cancellable, error))
goto out;
- if (_ostree_repo_sign_verify (pull_data, bytes_summary, signatures))
+ if (_ostree_repo_sign_verify (pull_data->repo, pull_data->remote_name, bytes_summary, signatures))
ret = TRUE;
}